package com.sean.uml.classrelationship.aggregation;

import java.util.ArrayList;
import java.util.List;

public class ClassMate {

    private List<Student> students;

    public ClassMate(List<Student> students) {
        this.students = students;
    }

    @Override
    public String toString() {
        return "ClassMate{" +
                "students=" + students +
                '}';
    }

    public static void main(String[] args) {
        Student student1 = new Student("tom");
        Student student2 = new Student("joy");
        List<Student> students = new ArrayList<>();
        students.add(student1);
        students.add(student2);
        ClassMate mate = new ClassMate(students);
        System.out.println(mate.toString());
    }
}
